<!--
 * @Author: Zhouxin 2201_75539691@noreply.gitcode.com
 * @Date: 2024-12-09 21:15:55
 * @LastEditors: Zhouxin 2201_75539691@noreply.gitcode.com
 * @LastEditTime: 2024-12-09 21:16:07
 * @FilePath: \2024.12.9-day14-this指向 包装对象 JSON\4.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        var obj1 = {
            name: '张三',
            eat: function () {
                console.log(this.name); //'张三'
            }
        }

        var obj2 = {
            name: '李四',
            eat: function () {
                console.log(this.name);
            }
        }

        obj1.eat();


    </script>
</body>

</html>